package com.weixing.mall.provider.model.vo.report.delivery;

import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.weixing.mall.base.constant.GlobalConstant;
import com.weixing.mall.provider.api.model.enums.OrderTypeEnum;
import com.weixing.mall.provider.model.enums.OrderStateEnum;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderStatusConverter;
import com.weixing.mall.provider.support.excel.EnumConverter.OrderTypeConverter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * @author jzy
 * @date 2020/6/2
 */
@Data
@Accessors(chain = true)
@ApiModel(value="DeliveryShipperSendDataVo", description="01发货部-发货员发货数据报表-详细数据")
@ContentRowHeight(40)
public class DeliveryShipperOutVo {
    @ApiModelProperty(value = "发货员Id")
    @ExcelIgnore
    private Long shipperId;
    @ApiModelProperty(value = "代理商Id")
    @ExcelIgnore
    private String agentId;
    @ApiModelProperty(value = "客服Id")
    @ExcelIgnore
    private String customerId;
    @ApiModelProperty(value = "仓库Id")
    @ExcelIgnore
    private String depotId;
    @ApiModelProperty(value = "商品图片")
    @ExcelIgnore
    private String goodsImg;
    @ApiModelProperty(value = "sku")
    @ExcelIgnore
    private String skuDesp;


    @ApiModelProperty(value = "订单号")
    @ExcelProperty("订单号")
    private String orderSn;
    @ExcelProperty("商品图片")
    @ColumnWidth(10)
    private URL goodsImgUrl;
    public void setGoodsImg(String goodsImg) {
        this.goodsImg = goodsImg;
        try {
            if (StrUtil.isNotEmpty(goodsImg)){
                this.goodsImgUrl=new URL(GlobalConstant.IMG_PATH_URL+goodsImg+GlobalConstant.IMG_PATH_URL_SUFFIX);
            }
        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
    }
    @ApiModelProperty(value = "商品信息")
    @ExcelProperty("商品信息")
    private String goodsName;
    @ApiModelProperty(value = "款号")
    @ExcelProperty("款号")
    private String styleNo;
    @ApiModelProperty(value = "颜色")
    @ExcelProperty("颜色")
    private String color;
    @ApiModelProperty(value = "尺码")
    @ExcelProperty("尺码")
    private String size;
    @ApiModelProperty(value = "发货员名称")
    @ExcelProperty("发货员名称")
    private String shipperName;
    @ApiModelProperty(value = "仓库名称")
    @ExcelProperty("仓库名称")
    private String depotName;
    @ApiModelProperty(value = "订单状态")
    @ExcelProperty(value = "订单状态",converter = OrderStatusConverter.class)
    private OrderStateEnum orderStatus;
    @ApiModelProperty(value = "代理商")
    @ExcelProperty("代理商")
    private String agentName;
    @ApiModelProperty(value = "客服")
    @ExcelProperty("客服")
    private String customerName;
    @ApiModelProperty(value = "客户名称")
    @ExcelProperty("客户名称")
    private String contactUser;
    @ApiModelProperty(value = "手机号")
    @ExcelProperty("手机号")
    private String contactPhone;
    @ApiModelProperty(value = "地址")
    @ExcelProperty("地址")
    private String address;
    @ApiModelProperty(value = "订单类型")
    @ExcelProperty(value = "订单类型",converter = OrderTypeConverter.class)
    private OrderTypeEnum orderType;
    @ApiModelProperty(value = "审核时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("审核时间")
    private String auditTime;
    @ApiModelProperty(value = "操作时间")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("操作时间")
    private String operateTime;
    @ApiModelProperty(value = "价格")
    @ExcelProperty("价格")
    private BigDecimal orderPrice;
    @ApiModelProperty(value = "外采价格")
    @ExcelProperty("外采价格")
    private BigDecimal outPrice;
}
